package xiaoluo.android.demo;

import xiaoluo.android.demo.javaAndroid.GenericActivity;
import xiaoluo.android.demo.javaAndroid.InstanceofActivity;
import xiaoluo.android.demo.javaAndroid.InterationActivity;
import xiaoluo.android.demo.javaAndroid.ThreadActivity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class toJavaAndroid extends Activity {
	Button buttonInstanceofActivity;
	Button buttonInterationActivity;
	Button buttonGenericActivity;
	Button buttonThreadActivity;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_to_javaandroid);
		
		buttonInstanceofActivity = (Button) findViewById(R.id.buttonInstanceofActivity);
		buttonInstanceofActivity.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(toJavaAndroid.this, InstanceofActivity.class);
				startActivity(intent);
			}
		});
		
		buttonInterationActivity = (Button) findViewById(R.id.buttonInterationActivity);
		buttonInterationActivity.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(toJavaAndroid.this, InterationActivity.class);
				startActivity(intent);
			}
		});
		
		buttonGenericActivity = (Button) findViewById(R.id.buttonGenericActivity);
		buttonGenericActivity.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(toJavaAndroid.this, GenericActivity.class);
				startActivity(intent);
			}
		});
		
		buttonThreadActivity = (Button) findViewById(R.id.buttonThreadActivity);
		buttonThreadActivity.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(toJavaAndroid.this, ThreadActivity.class);
				startActivity(intent);
			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}
}
